package com.shunwang.proj.pojo;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
 * ****************************
 * 版权所有：顺网科技 保留所有权利
 * 创建日期: 2011-7-1
 * 创建作者：胡新超
 * 文件名称：TGame.java
 * 版本： 1.0
 * 功能：游戏
 * 最后修改时间：2012-07-25
 * 修改记录：gameStatusMap添加新游戏状态：7-开服
****************************************
 */
public class TGame implements Serializable{
    
    private final static transient SimpleDateFormat formatDate = new SimpleDateFormat("MM-dd");
    
    // -- 游戏种类 --//
    //网络游戏
    public final static transient int gameNet = 0;
    //单机游戏
    public final static transient int gamePc = 1;
    //web游戏
    public final static transient int gameWeb = 2;
	
	public final static transient Map<Integer, String> gameEffectType = new HashMap<Integer, String>(){{
	    put(1, "2D");
        put(2, "2.5D");
        put(3, "3D");
        put(4, "混合");
	}};
	
	public final static transient Map<Integer,String> gameStatusMap = new HashMap<Integer,String>(){{
	    put(1,"公测");
	    put(2,"内测");
	    put(3,"封测");
	    put(4,"正式运营");
	    put(5,"未测");
	    put(6,"停运");
	    put(7,"开服");
	}};
	
	private static final long serialVersionUID = -7146189518158203993L;
	
	private Integer id;

    private String name;

    private String gamekey;

    private String pinyin;

    private Integer gametype;	// 游戏类型

    private Integer devcompany;

    private Integer operationcompany;

    private String logo;	// 游戏logo图片地址

    private String image;	//游戏专栏图片地址

    private String url;     //缺省导向链接

    private Integer chargetype;	// 收费模式(暂不用)

    private Integer state;	//状态（0、隐藏;1,显示）

    private Integer gameeffect;	// 游戏画面效果类型 1: 2d

    private Integer gamecategory;	// 首页tab页类型

    private Date onlinedate;	

    private String summary;

    private Integer gamestatus;	// 游戏状态
    
    private Boolean antiColor = false;
    //-----------找游戏-----------
    private Date statusdate; //测试日期

    private String carouselimage;  //轮播图片

    private String carouselurl;    //轮播图片Url

    private Integer gameid;        //王维游戏Id
    
    private String gamename;       //网维游戏名字

    private Byte iscarousel;       //是否轮播游戏图片
    
    private String imageurl; //专区导航页URL
    
    private String title;

    /**
     * 游戏画面效果
     * @return
     */
    public String getEffecType(){
    	String gameEffectName = gameEffectType.get(getGameeffect());
    	if(gameEffectName != null)
    		return gameEffectName;
    	return "其它";
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGamekey() {
        return gamekey;
    }

    public void setGamekey(String gamekey) {
        this.gamekey = gamekey;
    }

    public String getPinyin() {
        return pinyin;
    }

    public void setPinyin(String pinyin) {
        this.pinyin = pinyin;
    }

    public Integer getGametype() {
        return gametype;
    }

    public void setGametype(Integer gametype) {
        this.gametype = gametype;
    }

    public Integer getDevcompany() {
        return devcompany;
    }

    public void setDevcompany(Integer devcompany) {
        this.devcompany = devcompany;
    }

    public Integer getOperationcompany() {
        return operationcompany;
    }

    public void setOperationcompany(Integer operationcompany) {
        this.operationcompany = operationcompany;
    }

    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getChargetype() {
        return chargetype;
    }

    public void setChargetype(Integer chargetype) {
        this.chargetype = chargetype;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Integer getGameeffect() {
        return gameeffect;
    }

    public void setGameeffect(Integer gameeffect) {
        this.gameeffect = gameeffect;
    }

    public Integer getGamecategory() {
        return gamecategory;
    }

    public void setGamecategory(Integer gamecategory) {
        this.gamecategory = gamecategory;
    }

    public Date getOnlinedate() {
        return onlinedate;
    }

    public void setOnlinedate(Date onlinedate) {
        this.onlinedate = onlinedate;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public Integer getGamestatus() {
        return gamestatus;
    }

    public void setGamestatus(Integer gamestatus) {
        this.gamestatus = gamestatus;
    }
    
    public String getGameStatusString(){
        String gameStatus = gameStatusMap.get(this.getGamestatus());
        if(gameStatus == null){
            return "";
        }
        return gameStatus;
    }

    @Override
    public boolean equals(Object tGame) {
        if(!(tGame instanceof TGame))
        return false;
        TGame obj = (TGame)tGame;
        if(((obj.getId()==null && this.getId()==null)||(obj.getId()!=null && obj.getId().equals(this.getId()))||(this.getId()!=null && this.getId().equals(obj.getId()))))
        return true;
        return false;
    }

    public void setSelectKey(Object keyValue) {
        this.setId((java.lang.Integer)keyValue);
    }

    public Boolean getAntiColor() {
        return antiColor;
    }

    public void setAntiColor(Boolean antiColor) {
        this.antiColor = antiColor;
    }
    
    public void antiColorTrue(){
        this.antiColor = true;
    }
    
    public void antiColorFalse(){
        this.antiColor = false;
    }
    //--------------------------找游戏--------------------

    public Date getStatusdate() {
    	return statusdate;
    }
    
    public String getStatusdateStr() {
    	if(statusdate == null){
    		return "";
    	}
    	SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        return format.format(statusdate);
    }
    
    public String getStatusdateString(){
        if(statusdate == null){
            return "";
        }
        return formatDate.format(statusdate);
    }

    public void setStatusdate(Date statusdate) {
        this.statusdate = statusdate;
    }

    public String getCarouselimage() {
        return carouselimage;
    }

    public void setCarouselimage(String carouselimage) {
        this.carouselimage = carouselimage;
    }

    public String getCarouselurl() {
        return carouselurl;
    }

    public void setCarouselurl(String carouselurl) {
        this.carouselurl = carouselurl;
    }

    public Integer getGameid() {
        return gameid;
    }

    public void setGameid(Integer gameid) {
        this.gameid = gameid;
    }

    public Byte getIscarousel() {
        return iscarousel;
    }

    public void setIscarousel(Byte iscarousel) {
        this.iscarousel = iscarousel;
    }

    public String getImageurl() {
        return imageurl;
    }

    public void setImageurl(String imageurl) {
        this.imageurl = imageurl;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getGamename() {
        return gamename;
    }

    public void setGamename(String gamename) {
        this.gamename = gamename;
    }
}